'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  // home
  router.get('/', controller.home.index);

  // user
  router.get('/user/list', controller.user.list);
  router.post('/user/add', controller.user.add);
  router.get('/user/find', controller.user.find);
  router.post('/user/update', controller.user.update);
  router.patch('/user/delete', controller.user.delete);

  // menu
  router.get('/menu/list', controller.menu.list);
  router.post('/menu/add', controller.menu.add);
  router.post('/menu/update', controller.menu.update);
  router.patch('/menu/delete', controller.menu.delete);

  // role
  router.get('/role/list', controller.role.list);
  router.post('/role/add', controller.role.add);
  router.get('/role/find', controller.role.find);
  router.post('/role/update', controller.role.update);
  router.patch('/role/delete', controller.role.delete);
  router.get('/role/allRoles', controller.role.allList);
};
